//
//  YZXButtomView.swift
//  YZXWeibo
//
//  Created by 叶周翔 on 16/7/24.
//  Copyright © 2016年 叶周翔. All rights reserved.
//

import UIKit

class YZXButtomView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    func setUpUI(){
        self.addSubview(retweetBtn)
        self.addSubview(commentBtn)
        self.addSubview(likeBtn)
        self.addSubview(lineOne)
        self.addSubview(lineTow)
        
        // 设置约束
        retweetBtn.snp_makeConstraints { (make) -> Void in
            make.leading.top.bottom.equalTo(self)
            
        }
        
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(retweetBtn.snp_trailing)
            make.top.bottom.equalTo(self)
            make.width.equalTo(retweetBtn)
        }
        
        // 赞
        likeBtn.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(commentBtn.snp_trailing)
            make.top.bottom.trailing.equalTo(self)
            make.width.equalTo(retweetBtn)
        }
        
        // 竖线1
        lineOne.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(retweetBtn.snp_trailing)
            make.centerY.equalTo(retweetBtn)
        }
        // 竖线2
        lineTow.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentBtn.snp_trailing)
            make.centerY.equalTo(commentBtn)
        }
        
        
    }
    
    
    
    
    
    //MARK:- 懒加载控件
    lazy var retweetBtn:UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发")
    lazy var commentBtn:UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论")
    lazy var likeBtn:UIButton = UIButton(imageName: "timeline_icon_unlike", title: "赞")
    
    lazy var lineOne:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    lazy var lineTow:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
}
